/**
 * Created by g705353 on 10/30/2014.
 */

class Account{
    def name
    def balance

    //constructor defined
    def Account(name, balance){
        this.balance = balance
        this.name = name
    }
}

def acc1 = new Account("Irene", 9000)
//below only work with defalut constructor
//def acc1 = new Account(name: "Allen", balance: 700)

acc1.balance = 2000

acc1.setBalance(5000)

println("acc1: ${acc1.balance}, ${acc1.name}")

